#ifndef __GZ_INTERFACE_STREAM_CLIENT_H__
#define __GZ_INTERFACE_STREAM_CLIENT_H__

#include <string>
#include <functional>

namespace Gazella {

typedef std::function<void(const std::string&)> stream_response_callback_t;

class GzStreamClient {
public:
    GzStreamClient();
    ~GzStreamClient();

    //create a stream client
    int create_stream (
        const std::string& service_name, //service name to request
        const std::string& if_name, //stream server interface to request
        stream_response_callback_t callback, //stream server response callback (it will be called by the threadpool) 

        //if loadbalance == false
        //set host_ip and pod_ip uniquely specify a service
        bool loadbalance = true,
        const std::string& service_uuid = ""
    );

    //send payload to stream server
    void send_stream(const std::string& payload, const std::string& traceid = "", uint32_t priority = 0);

    //close connect to stream server
    void close_stream();

private:
    std::string m_stream_session;

    //service info 
    std::string m_service_name;
    std::string m_if_name;
    bool m_loadbalance;
    std::string m_service_uuid;
};
} //namespace Gazella

#endif

